package com.example.lanouhn.firstapp.activity.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.lanouhn.firstapp.R;
import com.example.lanouhn.firstapp.activity.utils.ToastUtils;


//意见反馈页面
public class FeedbackActivity extends AppCompatActivity {

    private ImageView imageView;
    //关于我们--跳转
    private TextView tv_aboutOur;
    //免责声明
    private TextView tv_disclaimer;
    //商务合作
    private TextView tv_cooperate;
    //帮助中心
    private TextView tv_help;
    //注销
    private TextView tv_cancellation;
    //提交
    private Button btn_submit;
    private EditText et_question;
    //返回
    private  ImageView iv_back;
    //个人中心
    private TextView mineCenter;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_feedback);


        //找到控件
        initView();
        //监听事件
        initEvent();
    }

    private void initEvent() {

        //关于我们--的点击事件
        tv_aboutOur.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(FeedbackActivity.this, AboutOurActivity.class);
                startActivity(intent);
            }
        });

        //免责声明--点击事件
        tv_disclaimer.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(FeedbackActivity.this, DisclaimerActivity.class);
                startActivity(intent);
            }
        });
        //商务合作--点击事件
        tv_cooperate.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(FeedbackActivity.this, CooperateActivity.class);
                startActivity(intent);
            }
        });
        //帮助中心--点击事件
        tv_help.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(FeedbackActivity.this, HelpActivity.class);
                startActivity(intent);
            }
        });
        //注销--点击事件
        tv_cancellation.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(FeedbackActivity.this, LoginActivity.class);
                startActivity(intent);
            }
        });

        //个人中心--点击事件
        mineCenter.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
        iv_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
        //提交监听事件
        btn_submit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if(et_question.getText().toString().equals("")){
                    ToastUtils.showToast(
                            getApplicationContext(), R.mipmap.xiao_lan, "请填写反馈内容");

                }else {
                    ToastUtils.showToast(
                            getApplicationContext(), R.mipmap.xiao_lan, "提交成功");
                    finish();
                }

            }
        });


    }

    private void initView() {
        mineCenter= (TextView) findViewById(R.id.mineCenter);
        iv_back= (ImageView) findViewById(R.id.iv_back);
        btn_submit= (Button) findViewById(R.id.btn_submit);
        et_question = (EditText) findViewById(R.id.et_question);

        //绑定控件
        tv_aboutOur = (TextView) findViewById(R.id.mine_aboutOur);
        tv_disclaimer = (TextView) findViewById(R.id.mine_disclaimer);
        tv_cooperate = (TextView) findViewById(R.id.mine_cooperate);
        tv_help = (TextView) findViewById(R.id.mine_help);
        tv_cancellation = (TextView) findViewById(R.id.mine_cancellation);


    }
}
